java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.nlogo.lite.AppletPanel
public abstract class AppletPanel
The superclass of org.nlogo.lite.InterfaceComponent. Also used by org.nlogo.lite.Applet.
See the "Controlling" section of the NetLogo User Manual for example code.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.BaselineResizeBehavior |
| Field Summary |
|---|
| Fields inherited from class javax.swing.JComponent |
|---|
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
AppletPanel(Frame frame,
MouseListener iconListener,
boolean isApplet)
|
|
| Method Summary | |
|---|---|
void |
addLinkComponent(Object c)
internal use only |
void |
command(String source)
Runs NetLogo commands and waits for them to complete. |
void |
commandLater(String source)
Runs NetLogo commands in the background. |
Object[] |
getLinkChildren()
internal use only |
String |
getProcedures()
Returns the contents of the Procedures tab. |
void |
handle(Throwable throwable)
internal use only |
static void |
main(String[] args)
|
void |
openFromSource(String name,
String path,
String source)
Opens a model stored in a string. |
Object |
report(String source)
Runs a NetLogo reporter. |
void |
requestFocus()
AppletPanel passes the focus request to the InterfacePanel |
void |
setAdVisible(boolean visible)
internal use only |
void |
setPrefix(URL url)
sets the current working directory |
void |
setProcedures(String source)
Replaces the contents of the Procedures tab. |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, setUI, updateUI |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public AppletPanel(Frame frame,
MouseListener iconListener,
boolean isApplet)
| Method Detail |
|---|
public void requestFocus()
requestFocus in class JComponentpublic void setAdVisible(boolean visible)
public void setPrefix(URL url)
url - the directory as java.net.URLpublic void handle(Throwable throwable)
handle in interface org.nlogo.util.Exceptions.Handlerpublic void addLinkComponent(Object c)
public Object[] getLinkChildren()
getLinkChildren in interface org.nlogo.window.Event.LinkParent
public void command(String source)
throws CompilerException
This method must not be called from the AWT event queue thread or while that thread is blocked. It is an error to do so.
source - The command or commands to run
CompilerException - if the code fails to compile
IllegalStateException - if called from the AWT event queue threadcommandLater(java.lang.String)
public void commandLater(String source)
throws CompilerException
This method may be called from any thread.
source - The command or commands to run
CompilerException - if the code fails to compilecommand(java.lang.String)
public Object report(String source)
throws CompilerException
This method must not be called from the AWT event queue thread or while that thread is blocked. It is an error to do so.
source - The reporter to run
LogoList,
Agent, AgentSet, or Nobody
CompilerException - if the code fails to compile
IllegalStateException - if called from the AWT event queue threadpublic String getProcedures()
public void setProcedures(String source)
source - new contents
public void openFromSource(String name,
String path,
String source)
throws org.nlogo.window.InvalidVersionException
name - Model name (will appear in the main window's title bar)source - The complete model, including widgets and so forth,
in the same format as it would be stored in a file.
org.nlogo.window.InvalidVersionExceptionpublic static void main(String[] args)